package com.ruoyi.order.controller;

import com.ruoyi.common.core.utils.poi.ExcelUtil;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.TableDataInfo;
import com.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import com.ruoyi.common.security.annotation.RequiresPermissions;
import com.ruoyi.order.domain.TbOrder;
import com.ruoyi.order.service.ITbOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 订单Controller
 * 
 * @author 12692
 * @date 2023-06-26
 */
@RestController
@RequestMapping("/order")
public class TbOrderController extends BaseController
{
    @Autowired
    private ITbOrderService tbOrderService;

    /**
     * 新增订单(表一)
     */
    @RequiresPermissions("order:order:insertTbOrderOne")
    @Log(title = "订单", businessType = BusinessType.INSERT)
    @PostMapping("/insertTbOrderOne")
    public AjaxResult insertTbOrderOne(@RequestBody TbOrder tbOrder)
    {
        return toAjax(tbOrderService.insertTbOrderOne(tbOrder));
    }

    /**
     * 新增订单(表三)
     */
    @RequiresPermissions("order:order:insertTbOrderThree")
    @Log(title = "订单", businessType = BusinessType.INSERT)
    @PostMapping("/insertTbOrderThree")
    public AjaxResult insertTbOrderThree(@RequestBody TbOrder tbOrder)
    {
        return toAjax(tbOrderService.insertTbOrderThree(tbOrder));
    }
}
